import axios from 'axios';

// 机构列表
export function getorgList(data: any) {
  return axios.get('/org/index', {
    params: data,
  });
}
// 获取所有机构
export function getOrgAll(data: any) {
  return axios.get('/org/all', {
    params: data,
  });
}
// 获取机构资料;
export function getOrgDetail(data: any) {
  return axios.get('/org/detail', {
    params: data,
  });
}

// 修改机构资料
export function editOrgDetail(data: any) {
  return axios.post('/org/edit', data);
}

// 新增机构资料
export function addOrg(data: any) {
  return axios.post('/org/add', data);
}

// 删除机构
export function delectOrg(data: any) {
  return axios.post('/org/delete', data);
}

// 部门管理
// 部门列表树级
export function getDept(data: any) {
  return axios.get('/dept/index', {
    params: data,
  });
}
// 部门列表下拉
export function getDeptSelect(data: any) {
  return axios.get('/dept/tree', {
    params: data,
  });
}
//部门详情
export function getDeptDetail(data: any) {
  return axios.get('/dept/detail', {
    params: data,
  });
}
// 新增部门
export function addDept(data: any) {
  return axios.post('/dept/add', data);
}
// 编辑部门
export function editDept(data: any) {
  return axios.post('/dept/edit', data);
}
// 删除部门
export function delectDept(data: any) {
  return axios.post('/dept/delete', data);
}

// 角色相关
// 角色列表
export function getRoleList(data: any) {
  return axios.get('/role/index', {
    params: data,
  });
}
// 角色详情
export function getRoleDetail(data: any) {
  return axios.get('/role/detail', {
    params: data,
  });
}
// 添加角色
export function addRole(data: any) {
  return axios.post('/role/add', data);
}
//删除角色
export function deleteRole(data: any) {
  return axios.post('/role/delete', data);
}
//编辑角色
export function editRole(data: any) {
  return axios.post('/role/edit', data);
}
//分配权限
export function authRole(data: any) {
  return axios.post('/role/auth', data);
}
// 所有角色
export function getAllRole(data: any) {
  return axios.get('/role/all', {
    params: data,
  });
}

// 用户设置相关
// 用户列表
export function getUserList(data: any) {
  return axios.get('/user/index', {
    params: data,
  });
}
// 用户详情
export function getUserDetail(data: any) {
  return axios.get('/user/detail', {
    params: data,
  });
}
// 删除用户
export function delectUser(data: any) {
  return axios.post('/user/delete', data);
}
// 编辑用户
export function editUser(data: any) {
  return axios.post('/user/edit', data);
}
// 添加用户
export function addUser(data: any) {
  return axios.post('/user/add', data);
}
// 设置用户状态
export function setStatus(data: any) {
  return axios.post('/user/state', data);
}

// 重置密码
export function restPwd(data: any) {
  return axios.post('/user/pwd', data);
}

//菜单管理相关
// 菜单列表
export function getMenuList(data: any) {
  return axios.get('/menu/index', {
    params: data,
  });
}

// 菜单详情
export function getMenuDetail(data: any) {
  return axios.get('/menu/detail', {
    params: data,
  });
}
// 添加菜单
export function addMenu(data: any) {
  return axios.post('/menu/add', data);
}
// 编辑菜单

export function editMenu(data: any) {
  return axios.post('/menu/edit', data);
}
// 删除菜单
export function deleteMenu(data: any) {
  return axios.post('/menu/delete', data);
}

// 流程定义
// 获取列表流程
export function getProcessList(data: any) {
  return axios.get('/approval_flow/index', {
    params: data,
  });
}
// 获取详情
export function getProcessDetail(data: any) {
  return axios.get('/approval_flow/detail', {
    params: data,
  });
}
// 新增流程
export function addProcess(data: any) {
  return axios.post('/approval_flow/add', data);
}
// 修改流程
export function editFlow(data: any) {
  return axios.post('/approval_flow/edit', data);
}
// 删除流程
export function deleteFlow(data: any) {
  return axios.post('/approval_flow/delete', data);
}
// 所有流程
export function getAllFlow(data: any) {
  return axios.get('/approval_flow/all', {
    params: data,
  });
}

// 备份
// 备份列表
export function getbackupList(data: any) {
  return axios.get('/backup/index', {
    params: data,
  });
}
// 备份详情
export function getbackupDetail(data: any) {
  return axios.get('/backup/detail', {
    params: data,
  });
}
// 删除备份
export function deleteBackUp(data: any) {
  return axios.post('/backup/delete', data);
}
// 添加备份
export function addBackup(data: any) {
  return axios.post('/backup/add', data);
}
// 立即备份
export function runBackup(data: any) {
  return axios.post('/backup/run', data);
}
// 编辑备份
export function editBackup(data: any) {
  return axios.post('/backup/edit', data);
}
// 网站设置
export function getNetWorkDetail(data: any) {
  return axios.get('/web_info/detail', {
    params: data,
  });
}
// 设置网站设置
export function saveNetWorkDetail(data: any) {
  return axios.post('/web_info/save', data);
}

// 消息通知相关
// 消息列表
export function getusermsglist(data: any) {
  return axios.get('/user_msg/index', {
    params: data,
  });
}
// 获取用户消息详情
export function getuserdetail(data: any) {
  return axios.get('/user_msg/detail', {
    params: data,
  });
}
//未读消息
export function getMsgCount(data: any) {
  return axios.get('/user_msg/num', {
    params: data,
  });
}
// 添加消息
export function addUserMessage(data: any) {
  return axios.post('/user_msg/add', data);
}
// 回复消息
export function replyUserMessage(data: any) {
  return axios.post('/user_msg/reply', data);
}
// 删除消息
export function deleteUserMessage(data: any) {
  return axios.post('/user_msg/delete', data);
}
